<template>
  <div class="playlist-card" @click="handClick(item.id)">
    <div class="left">
      <img :src="item.coverImgUrl" alt="" />
    </div>

    <div class="right">
      <div class="top">{{ item.name }}</div>
      <div class="bottom">
        {{ item.trackCount }}首音乐 by {{ item.creator.nickname }}，播放{{
          item.playCount | parsePlayCount
        }}次
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    item: Object,
  },
  methods: {
    // 点击进入歌单详情
    handClick(id) {
      this.$router.push({ path: "/playlist", query: { id } });
    },
  },
};
</script>

<style lang="less" scoped>
.playlist-card {
  width: 100%;
  height: 50px;
  margin-bottom: 15px;
  display: flex;

  .left {
    width: 50px;
    height: 100%;
    position: relative;

    img {
      border-radius: 10px;
    }
  }

  .right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 14px;
    margin-left: 15px;

    .bottom {
      font-size: 12px;
      color: #707070;
    }
  }

  &:last-of-type {
    margin-bottom: 0;
  }
}
</style>
